Skip to content

Fix AgentX profiling on SGLang without shape discovery - #117

Merged
haofrank merged 3 commits into
mainfrom
codex/sglang-profile-capabilities
Oct 8, 2026
Merged

haofrank merged 3 commits into
mainfrom
codex/sglang-profile-capabilities

Conversation

@haofrank

@haofrank haofrank commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Magpie now accepts SGLang detailed profiling when the runtime supports annotations but lacks shape discovery, addressing the capability check reported in #116.

  • Send shape_discovery and enable graph shape discovery only when the runtime supports them.
  • Keep the annotation API required for detailed profiling, and graph profiling support required when CUDA graphs are enabled.
  • Record the detected capabilities in launch evidence and capture manifests.

The existing SGLANG_GRAPH_BATCH_CAPTURE behavior is preserved. Patchless kernel_shape_tool integration is a separate follow-up.

Validation at d16f8013e:

  • 696 AgentX regression tests passed on Python 3.10.
  • Formatting checks passed; no new Ruff findings.
  • Linux Python 3.10/3.12 CI passed, including the coverage gate.

Boundary: GPU capture using the retained per-batch export path still needs validation for this revision. Full TraceLens/Roofline analysis and the Hyperloom optimization loop have not been validated. Annotation support alone does not establish trace quality for Roofline analysis.

Hyperloom must update its Magpie commit pin and audited package fingerprint to consume this fix.

Fixes #116.

@haofrank
haofrank requested a review from devalshahamd October 7, 2026 23:31
@mohbasit

mohbasit commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

https://github.com/AMD-AGI/TraceLens/tree/main/TraceLens/TraceUtils/kernel_shape_tool -> this is the Patchless tool that we use instead of shape_discovery. we need to run to see if this has to be exported into the PYTHONPATH at Magpie/Hyperloom

@haofrank

haofrank commented Oct 8, 2026 •

Copy link
Copy Markdown
Member Author

@mohbasit Since this is a feature that can be implemented in parallel, we can create another PR to add support for this tool kernel_shape_tool

@haofrank
haofrank requested a review from mohbasit October 8, 2026 01:08
Comment thread Magpie/modes/benchmark/agentx_launch.py Outdated
Comment thread Magpie/modes/benchmark/agentx_profile_config.py Outdated
@mohbasit

mohbasit commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Please limit this PR to make shape_discovery optional and not addition of a new flag SGLANG_ENABLE_CUDA_GRAPH_CAPTURE_TRACE

@haofrank
haofrank requested a review from mohbasit October 8, 2026 16:20
@haofrank
haofrank dismissed mohbasit’s stale review October 8, 2026 17:17

Deval has reviewed.

@haofrank
haofrank merged commit d80eb4d into main Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AgentX detailed profiling (used by Hyperloom's roofline step) refuses to run on SGLang 0.5.20 because it requires missing shape_discovery profile option

3 participants